<?php if(is_array($threadlist)) { foreach($threadlist as $_thread) { ?>

<li class="stream-item">
    <div class="stream-content thread <?php echo $_thread['thread_class']; ?> <?php echo $_thread['top_class']; ?>"
         href="<?php echo $_thread['url']; ?>" tid="<?php echo $_thread['tid']; ?>"
         last_date="<?php echo $_thread['last_date']; ?>">
        <a href="<?php echo $_thread['user_url']; ?>" class="item-user">
            <img class="item-avatar lazyload" data-src="<?php echo $_thread['user_avatar_url']; ?>" width="48px"
                 height="48px" alt="<?php echo $_thread['username']; ?>">
            <!--<span class="item-nickname">-->
            <!--&lt;!&ndash;<?php echo $_thread['username']; ?>&ndash;&gt;-->
            <!--<?php if(!$fid) { ?>-->
            <!--<a href="forum-<?php echo $_thread['fid']; ?>.htm"><?php echo $_thread['forumname']; ?></a>-->
            <!--<?php } ?>-->
            <!--</span>-->
        </a>
        <!--<small class="time" title="发帖时间">-->
        <!--<span class="point">·</span>-->
        <!--<?php echo $_thread['create_date_fmt']; ?>-->
        <!--</small>-->

        <?php if($_thread['files'] > 0) { ?>
        <span class="point">·</span>
        <i class="fa fa-thumb-tack f14 text-muted" title="置顶帖"></i>
        <?php } ?>

        <!--<?php if(!$fid) { ?>-->
        <!--<div class="right-text">-->
        <!--<a href="forum-<?php echo $_thread['fid']; ?>.htm"><?php echo $_thread['forumname']; ?></a>-->
        <!--</div>-->
        <!--<?php } ?>-->

        <p class="item-message">
            <?php if(!$fid) { ?>
            <a href="forum-<?php echo $_thread['fid']; ?>.htm">[<?php echo $_thread['forumname']; ?>]</a>
            <?php } ?>

            <?php if(forum_access_mod($_thread['fid'], $gid, 'allowtop')) { ?>
            <input type="checkbox" name="tid" value="<?php echo $_thread['tid']; ?>">
            <?php } ?>
            <?php echo $_thread['subject']; ?>
            <?php if($_thread['top'] > 0) { ?>
            <img class="icon" src="pc/view/img/icon-zd.png" alt="置顶">
            <?php } ?>

            <?php if($_thread['images'] > 0) { ?>
            <!--<div class="item-picture">-->
            <!--<?php foreach($imgs as $pic) { ?>-->
            <!--<img class="lazyload" data-src="<?php echo $pic ?>">-->
            <!--<?php } ?>-->
            <!--</div>-->
            <img class="icon" src="http://www.ittun.com/images/img.png" alt="图">
            <?php } ?>
            <img class="icon" src="http://www.ittun.com/images/zan.png" alt="赞">
        </p>
        <?php
$post = post_read($_thread['firstpid']);
$content =($post['message']);
$message = strip_tags($content);
$jianjie = mb_substr($message,0,80,'utf-8');
$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";
        preg_match_all($pattern,$content,$match);
        $imgs=array();
        for($i=0;$i<1;$i++){
        if(!empty($match[0][$i])){
        $imgs[$i]=$match[1][$i];
        }
        }
        ?>
        <!--<?php if($_thread['images'] > 0) { ?>-->
        <!--&lt;!&ndash;<div class="item-picture">&ndash;&gt;-->
        <!--&lt;!&ndash;&lt;!&ndash;<?php foreach($imgs as $pic) { ?>&ndash;&gt;&ndash;&gt;-->
        <!--&lt;!&ndash;&lt;!&ndash;&lt;!&ndash;<img class="lazyload" data-src="<?php echo $pic ?>">&ndash;&gt;&ndash;&gt;&ndash;&gt;-->
        <!--&lt;!&ndash;&lt;!&ndash;<?php } ?>&ndash;&gt;&ndash;&gt;-->
        <!--&lt;!&ndash;</div>&ndash;&gt;-->
        <!--<?php } ?>-->
        <div class="post-actions">
                <span class="first">
                    <?php echo $_thread['username']; ?>
                </span>

                <span class="point">·
                    <?php echo $_thread['create_date_fmt']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </span>

                <span class="views">
                    <!--<i class="icon iconfont">&#xe668;</i>-->
                    <i class="icon-eye-open" aria-hidden="true"></i>
                     <?php echo $_thread['views']; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </span>

               <a class="post" href="<?php echo $_thread['url']; ?><?php echo (!empty($keyword) ? '?keyword='.$keyword : ''); ?>"
                       title="<?php echo $_thread['posts']; ?> 回复">
                        <i class="post-icon"></i>
                        <span class="replies"><?php echo $_thread['posts']; ?></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              </a>

                <span class="like" title="<?php echo $_thread['agrees']; ?> 喜欢">
                    <i class="fa-heart"></i>
                    <span class="likes"><?php echo $_thread['agrees']; ?></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </span>


                <?php if($_thread['posts'] > 0) { ?>
                <div class="post-actions-right" title="回复于 <?php echo $_thread['last_date_fmt']; ?>">
                    最后回复
                    <!--<i class="fa fa-reply"></i>-->
                    <?php echo $_thread['lastusername']; ?> <?php echo $_thread['last_date_fmt']; ?>
                </div>
                <?php } ?>

        </div>
    </div>
</li>

<?php } } ?>
